<%@ include file="/includes/includes.jsp" %>
<%@ page language="Java" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<form:form action="/admin/saveAclRoleMatrix.do" commandName="aclPermissionsMatrix">
    <form:hidden path="clazz"/>
    <div class="table_wrapper">
        <div>
            <div>
                <div style="width: 100%;">
                    <table border="0" cellspacing="0" cellpadding="0" class="table_data">
                        <thead>
                        <tr>
                            <th class="th_data_first">Объекты/Роли</th>
                            <c:forEach var="recipient" items="${aclRecipients}" varStatus="recipientindex">
                                <th class="th_data"><c:out value="${recipient.name}"/><br>(<c:out
                                        value="${recipient.code}"/>)
                                </th>
                            </c:forEach>
                        </tr>
                        </thead>
                        <c:forEach var="entry" items="${aclEntries}" varStatus="entryindex">
                            <tr class="${entryindex.index % 2 == 0 ? 'even' : 'odd'}">
                                <td class="td_data_first"><c:out value="${entry.login}"/></td>
                                <c:forEach var="recipient1" items="${aclRecipients}" varStatus="recipientindex1">
                                    <td class="td_data">
                                        <input type="hidden" name="permissions"
                                               value="0#${entry.id}#0#${recipient1.code}"/>
                                        <form:checkbox path="permissions" value="1#${entry.id}#0#${recipient1.code}"/>
                                        <form:checkbox path="permissions" value="2#${entry.id}#0#${recipient1.code}"/>
                                        <form:checkbox path="permissions" value="4#${entry.id}#0#${recipient1.code}"/>
                                        <form:checkbox path="permissions" value="8#${entry.id}#0#${recipient1.code}"/>
                                        <form:checkbox path="permissions" value="16#${entry.id}#0#${recipient1.code}"/>
                                    </td>
                                </c:forEach>
                            </tr>
                        </c:forEach>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div>
        <input type="submit" name="save" value="<spring:message code='save'/>" class="margin2p"/>
            <%--<a href="/admin/saveAclRoleMatrix.do" title="<spring:message code='save'/>"><img--%>
            <%--border="0" src="/images/save.gif" alt="<spring:message code='save'/>"></a>--%>
    </div>
</form:form>